home *** CD-ROM | disk | FTP | other *** search
open in:
MacOS 8.1
|
Win98
|
DOS
browse contents |
view JSON data
|
view as text
This file was processed as: LaTeX Document
(document/latex).
Confidence | Program | Detection | Match Type | Support
|
---|
100%
| dexvert
| LaTeX Document (document/latex)
| magic
| Supported |
1%
| dexvert
| Text File (text/txt)
| fallback
| Supported |
100%
| file
| C source text
| default
| |
99%
| file
| C source, ASCII text
| default
| |
100%
| checkBytes
| Printable ASCII
| default
| |
100%
| perlTextCheck
| Likely Text (Perl)
| default
| |
100%
| siegfried
| fmt/281 LaTeX (Subdocument)
| default
| |
100%
| gt2
| Textdatei (UNIX)
| default
| |
100%
| detectItEasy
| Format: plain text[LF]
| default (weak)
|
|
hex view+--------+-------------------------+-------------------------+--------+--------+
|00000000| 25 20 43 6f 70 79 72 69 | 67 68 74 20 31 39 39 31 |% Copyri|ght 1991|
|00000010| 20 62 79 20 4e 6f 72 6d | 61 6e 20 52 61 6d 73 65 | by Norm|an Ramse|
|00000020| 79 2e 20 20 41 6c 6c 20 | 72 69 67 68 74 73 20 72 |y. All |rights r|
|00000030| 65 73 65 72 76 65 64 2e | 0a 25 20 53 65 65 20 66 |eserved.|.% See f|
|00000040| 69 6c 65 20 43 4f 50 59 | 52 49 47 48 54 20 66 6f |ile COPY|RIGHT fo|
|00000050| 72 20 6d 6f 72 65 20 69 | 6e 66 6f 72 6d 61 74 69 |r more i|nformati|
|00000060| 6f 6e 2e 0a 5c 73 75 62 | 73 65 63 74 69 6f 6e 7b |on..\sub|section{|
|00000070| 45 72 72 6f 72 20 6d 65 | 73 73 61 67 65 73 7d 0a |Error me|ssages}.|
|00000080| 48 65 72 65 20 69 73 20 | 61 20 62 69 67 20 73 65 |Here is |a big se|
|00000090| 74 20 6f 66 20 66 75 6e | 63 74 69 6f 6e 73 20 74 |t of fun|ctions t|
|000000a0| 68 61 74 20 6f 74 68 65 | 72 20 70 6c 61 63 65 73 |hat othe|r places|
|000000b0| 20 63 61 6e 20 63 61 6c | 6c 20 74 6f 20 69 73 73 | can cal|l to iss|
|000000c0| 75 65 0a 65 72 72 6f 72 | 20 6d 65 73 73 61 67 65 |ue.error| message|
|000000d0| 73 2e 0a 49 74 20 6d 69 | 67 68 74 20 62 65 20 77 |s..It mi|ght be w|
|000000e0| 6f 72 74 68 20 69 6d 70 | 6c 65 6d 65 6e 74 69 6e |orth imp|lementin|
|000000f0| 67 20 74 68 65 73 65 20 | 61 73 20 6d 61 63 72 6f |g these |as macro|
|00000100| 73 20 73 6f 20 74 68 65 | 79 20 63 6f 75 6c 64 20 |s so the|y could |
|00000110| 69 6e 64 69 63 61 74 65 | 0a 74 68 65 20 66 69 6c |indicate|.the fil|
|00000120| 65 20 6e 61 6d 65 20 61 | 6e 64 20 6c 69 6e 65 20 |e name a|nd line |
|00000130| 6e 75 6d 62 65 72 20 69 | 6e 20 74 68 65 20 73 6f |number i|n the so|
|00000140| 75 72 63 65 20 6f 66 20 | 77 68 65 72 65 20 74 68 |urce of |where th|
|00000150| 65 79 20 77 65 72 65 20 | 63 61 6c 6c 65 64 2e 0a |ey were |called..|
|00000160| 5b 5b 65 72 72 6f 72 6c | 65 76 65 6c 5d 5d 20 69 |[[errorl|evel]] i|
|00000170| 73 20 61 6e 20 69 6e 74 | 65 67 65 72 20 74 68 61 |s an int|eger tha|
|00000180| 74 20 73 61 79 73 20 68 | 6f 77 20 62 61 64 20 74 |t says h|ow bad t|
|00000190| 68 65 20 77 6f 72 73 74 | 20 65 72 72 6f 72 20 73 |he worst| error s|
|000001a0| 6f 20 66 61 72 0a 68 61 | 73 20 62 65 65 6e 2e 0a |o far.ha|s been..|
|000001b0| 5b 5b 6e 65 77 65 72 72 | 6f 72 6c 65 76 65 6c 5d |[[newerr|orlevel]|
|000001c0| 5d 20 77 69 6c 6c 20 75 | 70 64 61 74 65 20 69 74 |] will u|pdate it|
|000001d0| 20 63 6f 6e 64 69 74 69 | 6f 6e 61 6c 6c 79 2e 0a | conditi|onally..|
|000001e0| 53 6f 6d 65 20 64 61 79 | 20 77 65 20 73 68 6f 75 |Some day| we shou|
|000001f0| 6c 64 20 68 69 64 65 20 | 69 74 20 61 6e 64 20 67 |ld hide |it and g|
|00000200| 69 76 65 20 74 68 65 20 | 77 6f 72 6c 64 20 61 20 |ive the |world a |
|00000210| 66 75 6e 63 74 69 6f 6e | 20 63 61 6c 6c 20 74 68 |function| call th|
|00000220| 61 74 0a 71 75 65 72 69 | 65 73 20 69 74 2e 0a 3c |at.queri|es it..<|
|00000230| 3c 2a 3e 3e 3d 0a 23 69 | 6e 63 6c 75 64 65 20 3c |<*>>=.#i|nclude <|
|00000240| 73 74 64 69 6f 2e 68 3e | 0a 23 69 6e 63 6c 75 64 |stdio.h>|.#includ|
|00000250| 65 20 3c 73 74 64 6c 69 | 62 2e 68 3e 0a 23 69 6e |e <stdli|b.h>.#in|
|00000260| 63 6c 75 64 65 20 3c 73 | 74 72 69 6e 67 2e 68 3e |clude <s|tring.h>|
|00000270| 0a 23 69 6e 63 6c 75 64 | 65 20 3c 73 74 64 61 72 |.#includ|e <stdar|
|00000280| 67 2e 68 3e 0a 23 69 6e | 63 6c 75 64 65 20 22 65 |g.h>.#in|clude "e|
|00000290| 72 72 6f 72 73 2e 68 22 | 0a 3c 3c 43 20 66 75 6e |rrors.h"|.<<C fun|
|000002a0| 63 74 69 6f 6e 73 3e 3e | 0a 49 20 74 72 61 63 6b |ctions>>|.I track|
|000002b0| 20 64 65 67 72 65 65 73 | 20 6f 66 20 65 72 72 6f | degrees| of erro|
|000002c0| 72 20 61 73 20 74 68 65 | 79 20 6f 63 63 75 72 2e |r as the|y occur.|
|000002d0| 0a 3c 3c 68 65 61 64 65 | 72 3e 3e 3d 0a 65 6e 75 |.<<heade|r>>=.enu|
|000002e0| 6d 20 65 72 72 6f 72 6c | 65 76 65 6c 20 7b 20 4e |m errorl|evel { N|
|000002f0| 6f 72 6d 61 6c 3d 30 2c | 20 57 61 72 6e 69 6e 67 |ormal=0,| Warning|
|00000300| 2c 20 45 72 72 6f 72 2c | 20 46 61 74 61 6c 2c 20 |, Error,| Fatal, |
|00000310| 49 6d 70 6f 73 73 69 62 | 6c 65 20 7d 3b 0a 65 78 |Impossib|le };.ex|
|00000320| 74 65 72 6e 20 65 6e 75 | 6d 20 65 72 72 6f 72 6c |tern enu|m errorl|
|00000330| 65 76 65 6c 20 65 72 72 | 6f 72 6c 65 76 65 6c 3b |evel err|orlevel;|
|00000340| 0a 40 20 25 64 65 66 20 | 65 72 72 6f 72 6c 65 76 |.@ %def |errorlev|
|00000350| 65 6c 0a 3c 3c 43 20 66 | 75 6e 63 74 69 6f 6e 73 |el.<<C f|unctions|
|00000360| 3e 3e 3d 0a 65 6e 75 6d | 20 65 72 72 6f 72 6c 65 |>>=.enum| errorle|
|00000370| 76 65 6c 20 65 72 72 6f | 72 6c 65 76 65 6c 20 3d |vel erro|rlevel =|
|00000380| 20 4e 6f 72 6d 61 6c 3b | 0a 54 68 65 20 72 65 73 | Normal;|.The res|
|00000390| 74 20 69 73 20 6a 75 73 | 74 20 76 61 72 79 69 6e |t is jus|t varyin|
|000003a0| 67 20 66 6c 61 76 6f 72 | 73 20 6f 66 20 65 72 72 |g flavor|s of err|
|000003b0| 6f 72 20 6d 65 73 73 61 | 67 65 73 2e 0a 3c 3c 68 |or messa|ges..<<h|
|000003c0| 65 61 64 65 72 3e 3e 3d | 0a 76 6f 69 64 20 65 72 |eader>>=|.void er|
|000003d0| 72 6f 72 6d 73 67 28 65 | 6e 75 6d 20 65 72 72 6f |rormsg(e|num erro|
|000003e0| 72 6c 65 76 65 6c 20 6c | 65 76 65 6c 2c 20 63 68 |rlevel l|evel, ch|
|000003f0| 61 72 20 2a 73 2c 20 2e | 2e 2e 29 3b 0a 23 64 65 |ar *s, .|..);.#de|
|00000400| 66 69 6e 65 20 6f 76 65 | 72 66 6c 6f 77 28 53 29 |fine ove|rflow(S)|
|00000410| 20 65 72 72 6f 72 6d 73 | 67 28 46 61 74 61 6c 2c | errorms|g(Fatal,|
|00000420| 22 43 61 70 61 63 69 74 | 79 20 65 78 63 65 65 64 |"Capacit|y exceed|
|00000430| 65 64 3a 20 25 73 22 2c | 20 53 29 0a 23 64 65 66 |ed: %s",| S).#def|
|00000440| 69 6e 65 20 69 6d 70 6f | 73 73 69 62 6c 65 28 53 |ine impo|ssible(S|
|00000450| 29 20 65 72 72 6f 72 6d | 73 67 28 49 6d 70 6f 73 |) errorm|sg(Impos|
|00000460| 73 69 62 6c 65 2c 20 22 | 54 68 69 73 20 63 61 6e |sible, "|This can|
|00000470| 27 74 20 68 61 70 70 65 | 6e 3a 20 25 73 22 2c 20 |'t happe|n: %s", |
|00000480| 53 29 0a 23 64 65 66 69 | 6e 65 20 63 68 65 63 6b |S).#defi|ne check|
|00000490| 70 74 72 28 50 29 20 64 | 6f 20 7b 20 69 66 20 28 |ptr(P) d|o { if (|
|000004a0| 21 28 50 29 29 20 6f 76 | 65 72 66 6c 6f 77 28 22 |!(P)) ov|erflow("|
|000004b0| 6d 65 6d 6f 72 79 22 29 | 3b 20 7d 20 77 68 69 6c |memory")|; } whil|
|000004c0| 65 20 28 30 29 0a 40 20 | 25 64 65 66 20 65 72 72 |e (0).@ |%def err|
|000004d0| 6f 72 6d 73 67 20 6f 76 | 65 72 66 6c 6f 77 20 69 |ormsg ov|erflow i|
|000004e0| 6d 70 6f 73 73 69 62 6c | 65 20 63 68 65 63 6b 70 |mpossibl|e checkp|
|000004f0| 74 72 0a 3c 3c 43 20 66 | 75 6e 63 74 69 6f 6e 73 |tr.<<C f|unctions|
|00000500| 3e 3e 3d 0a 76 6f 69 64 | 20 65 72 72 6f 72 6d 73 |>>=.void| errorms|
|00000510| 67 28 65 6e 75 6d 20 65 | 72 72 6f 72 6c 65 76 65 |g(enum e|rrorleve|
|00000520| 6c 20 6c 65 76 65 6c 2c | 20 63 68 61 72 20 2a 73 |l level,| char *s|
|00000530| 2c 2e 2e 2e 29 20 7b 20 | 20 20 20 20 0a 20 20 20 |,...) { | . |
|00000540| 20 76 61 5f 6c 69 73 74 | 20 61 72 67 73 3b 20 20 | va_list| args; |
|00000550| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000560| 20 20 20 20 20 2f 2a 20 | 73 65 65 20 4b 26 52 2c | /* |see K&R,|
|00000570| 20 70 61 67 65 20 31 37 | 34 20 2a 2f 0a 20 20 20 | page 17|4 */. |
|00000580| 20 76 61 5f 73 74 61 72 | 74 28 61 72 67 73 2c 73 | va_star|t(args,s|
|00000590| 29 3b 0a 20 20 20 20 3c | 3c 73 65 74 20 5b 5b 65 |);. <|<set [[e|
|000005a0| 72 72 6f 72 6c 65 76 65 | 6c 5d 5d 20 61 6e 64 20 |rrorleve|l]] and |
|000005b0| 70 72 69 6e 74 20 5b 5b | 73 5d 5d 20 77 69 74 68 |print [[|s]] with|
|000005c0| 20 5b 5b 61 72 67 73 5d | 5d 3e 3e 0a 20 20 20 20 | [[args]|]>>. |
|000005d0| 76 61 5f 65 6e 64 28 61 | 72 67 73 29 3b 0a 20 20 |va_end(a|rgs);. |
|000005e0| 20 20 69 66 20 28 6c 65 | 76 65 6c 20 3e 3d 20 46 | if (le|vel >= F|
|000005f0| 61 74 61 6c 29 0a 20 20 | 20 20 20 20 20 20 65 78 |atal). | ex|
|00000600| 69 74 28 6c 65 76 65 6c | 29 3b 0a 40 20 25 64 65 |it(level|);.@ %de|
|00000610| 66 20 65 72 72 6f 72 6d | 73 67 0a 3c 3c 68 65 61 |f errorm|sg.<<hea|
|00000620| 64 65 72 3e 3e 3d 0a 76 | 6f 69 64 20 65 72 72 6f |der>>=.v|oid erro|
|00000630| 72 61 74 28 63 68 61 72 | 20 2a 66 69 6c 65 6e 61 |rat(char| *filena|
|00000640| 6d 65 2c 20 69 6e 74 20 | 6c 69 6e 65 6e 6f 2c 20 |me, int |lineno, |
|00000650| 65 6e 75 6d 20 65 72 72 | 6f 72 6c 65 76 65 6c 20 |enum err|orlevel |
|00000660| 6c 65 76 65 6c 2c 20 63 | 68 61 72 20 2a 73 2c 20 |level, c|har *s, |
|00000670| 2e 2e 2e 29 3b 0a 3c 3c | 43 20 66 75 6e 63 74 69 |...);.<<|C functi|
|00000680| 6f 6e 73 3e 3e 3d 0a 76 | 6f 69 64 20 65 72 72 6f |ons>>=.v|oid erro|
|00000690| 72 61 74 28 63 68 61 72 | 20 2a 66 69 6c 65 6e 61 |rat(char| *filena|
|000006a0| 6d 65 2c 20 69 6e 74 20 | 6c 69 6e 65 6e 6f 2c 20 |me, int |lineno, |
|000006b0| 65 6e 75 6d 20 65 72 72 | 6f 72 6c 65 76 65 6c 20 |enum err|orlevel |
|000006c0| 6c 65 76 65 6c 2c 20 63 | 68 61 72 20 2a 73 2c 20 |level, c|har *s, |
|000006d0| 2e 2e 2e 29 20 7b 20 20 | 20 20 20 0a 20 20 20 20 |...) { | . |
|000006e0| 76 61 5f 6c 69 73 74 20 | 61 72 67 73 3b 20 20 20 |va_list |args; |
|000006f0| 20 20 20 20 20 20 20 20 | 20 20 20 20 20 20 20 20 | | |
|00000700| 20 20 20 20 2f 2a 20 73 | 65 65 20 4b 26 52 2c 20 | /* s|ee K&R, |
|00000710| 70 61 67 65 20 31 37 34 | 20 2a 2f 0a 20 20 20 20 |page 174| */. |
|00000720| 76 61 5f 73 74 61 72 74 | 28 61 72 67 73 2c 73 29 |va_start|(args,s)|
|00000730| 3b 0a 20 20 20 20 66 70 | 72 69 6e 74 66 28 73 74 |;. fp|rintf(st|
|00000740| 64 65 72 72 2c 20 22 5c | 22 25 73 5c 22 2c 20 6c |derr, "\|"%s\", l|
|00000750| 69 6e 65 20 25 64 3a 20 | 22 2c 20 66 69 6c 65 6e |ine %d: |", filen|
|00000760| 61 6d 65 2c 20 6c 69 6e | 65 6e 6f 29 3b 0a 20 20 |ame, lin|eno);. |
|00000770| 20 20 3c 3c 73 65 74 20 | 5b 5b 65 72 72 6f 72 6c | <<set |[[errorl|
|00000780| 65 76 65 6c 5d 5d 20 61 | 6e 64 20 70 72 69 6e 74 |evel]] a|nd print|
|00000790| 20 5b 5b 73 5d 5d 20 77 | 69 74 68 20 5b 5b 61 72 | [[s]] w|ith [[ar|
|000007a0| 67 73 5d 5d 3e 3e 0a 20 | 20 20 20 76 61 5f 65 6e |gs]]>>. | va_en|
|000007b0| 64 28 61 72 67 73 29 3b | 0a 20 20 20 20 69 66 20 |d(args);|. if |
|000007c0| 28 6c 65 76 65 6c 20 3e | 3d 20 46 61 74 61 6c 29 |(level >|= Fatal)|
|000007d0| 0a 20 20 20 20 20 20 20 | 20 65 78 69 74 28 6c 65 |. | exit(le|
|000007e0| 76 65 6c 29 3b 0a 40 20 | 25 64 65 66 20 65 72 72 |vel);.@ |%def err|
|000007f0| 6f 72 61 74 0a 3c 3c 73 | 65 74 20 5b 5b 65 72 72 |orat.<<s|et [[err|
|00000800| 6f 72 6c 65 76 65 6c 5d | 5d 20 61 6e 64 20 70 72 |orlevel]|] and pr|
|00000810| 69 6e 74 20 5b 5b 73 5d | 5d 20 77 69 74 68 20 5b |int [[s]|] with [|
|00000820| 5b 61 72 67 73 5d 5d 3e | 3e 3d 0a 69 66 20 28 6c |[args]]>|>=.if (l|
|00000830| 65 76 65 6c 20 3e 20 65 | 72 72 6f 72 6c 65 76 65 |evel > e|rrorleve|
|00000840| 6c 29 0a 20 20 20 20 65 | 72 72 6f 72 6c 65 76 65 |l). e|rrorleve|
|00000850| 6c 20 3d 20 6c 65 76 65 | 6c 3b 0a 76 66 70 72 69 |l = leve|l;.vfpri|
|00000860| 6e 74 66 28 73 74 64 65 | 72 72 2c 20 73 2c 20 61 |ntf(stde|rr, s, a|
|00000870| 72 67 73 29 3b 0a 66 70 | 72 69 6e 74 66 28 73 74 |rgs);.fp|rintf(st|
|00000880| 64 65 72 72 2c 22 5c 6e | 22 29 3b 0a 53 6f 6d 65 |derr,"\n|");.Some|
|00000890| 20 6f 6c 64 65 72 20 6d | 61 63 68 69 6e 65 73 20 | older m|achines |
|000008a0| 64 6f 6e 27 74 20 64 6f | 20 5b 5b 76 66 70 72 69 |don't do| [[vfpri|
|000008b0| 6e 74 66 5d 5d 3b 20 68 | 65 72 65 27 73 20 61 6e |ntf]]; h|ere's an|
|000008c0| 20 69 6d 70 6c 65 6d 65 | 6e 74 61 74 69 6f 6e 3a | impleme|ntation:|
|000008d0| 0a 3c 3c 63 72 6f 63 6b | 20 66 6f 72 20 6e 6f 6e |.<<crock| for non|
|000008e0| 2d 41 4e 53 49 20 6d 61 | 63 68 69 6e 65 73 3e 3e |-ANSI ma|chines>>|
|000008f0| 3d 0a 65 78 74 65 72 6e | 20 69 6e 74 20 5f 64 6f |=.extern| int _do|
|00000900| 70 72 6e 74 28 63 6f 6e | 73 74 20 63 68 61 72 20 |prnt(con|st char |
|00000910| 2a 66 6f 72 6d 61 74 2c | 20 76 61 5f 6c 69 73 74 |*format,| va_list|
|00000920| 20 61 72 67 73 2c 20 46 | 49 4c 45 20 2a 73 74 72 | args, F|ILE *str|
|00000930| 65 61 6d 29 3b 0a 69 6e | 74 20 76 66 70 72 69 6e |eam);.in|t vfprin|
|00000940| 74 66 28 46 49 4c 45 20 | 2a 73 74 72 65 61 6d 2c |tf(FILE |*stream,|
|00000950| 20 63 6f 6e 73 74 20 63 | 68 61 72 20 2a 66 6f 72 | const c|har *for|
|00000960| 6d 61 74 2c 20 76 61 5f | 6c 69 73 74 20 61 72 67 |mat, va_|list arg|
|00000970| 29 20 7b 20 0a 20 20 20 | 20 72 65 74 75 72 6e 20 |) { . | return |
|00000980| 5f 64 6f 70 72 6e 74 28 | 66 6f 72 6d 61 74 2c 61 |_doprnt(|format,a|
|00000990| 72 67 2c 73 74 72 65 61 | 6d 29 3b 0a |rg,strea|m);. |
+--------+-------------------------+-------------------------+--------+--------+